package cmd

/*配置文件解析*/
type Configuration struct {
	Server   Server
	Database Database
	Log      Log
	Minio    Minio
	Redis    Redis
}
type Server struct {
	Port   string `json: "port" yaml:"port" mapstructure:"port"`
	Upload string `json: "upload" yaml:"upload" mapstructure:"upload"`
}

type Database struct {
	UserName string `json: "username" yaml:"username" mapstructure:"username"`
	PassWord string `json: "password" yaml:"password" mapstructure:"password"`
	Address  string `json: "address" yaml:"address" mapstructure:"address"`
	Port     string `json: "port" yaml:"port" mapstructure:"port"`
	DBName   string `json: "db_name" yaml:"db_name" mapstructure:"db_name"`
}

type Log struct {
	Root_dir  string `json:"root_dir"`
	FileName  string `json:"filename`
	MaxSize   int    `json:"max_size`
	MaxBackup int    `json:"max_backup`
	MaxAge    int    `json:"max_age"`
	Level     string `json:"level"`
}

type Minio struct {
	AccessKey string `json:"access_key"`
	SecretKey string `json:"secret_key"`
	EndPoint  string `json:"endpoint"`
	Port      string `json:"port"`
	Location  string `json:"location"`
	// BucketName string `json:"bucket_name"`
	UseSSL bool `json:"use_ssl"`
}

type Redis struct {
	Addr     string `json:"addr"`
	Password string `json:"password"`
	Port     string `json:"port"`
	DB       int    `json:"db"`
}
